package in.animeshpathak.saferstreets.models;

import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.users.User;

/**
 * The notion of a user in the app. Just a way to allow richer profiles
 * @author animesh
 *
 */
@PersistenceCapable
public class SaferStreetsUser {
	
	@Persistent
	/** The Google user object */
	private User user;
	
	
	/** The key to the incident report */
	/* @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key; */
	
	@Persistent
	@PrimaryKey
	/** The user ID. This is unique across User objects */
	private String userId;
	
	@Persistent()
	private List<IncidentReport> incidents;

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public SaferStreetsUser(User user, String userId) {
		super();
		this.user = user;
		this.userId = userId;
		this.incidents = new ArrayList<IncidentReport>();
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public List<IncidentReport> getIncidents() {
		return incidents;
	}

	public void setIncidents(List<IncidentReport> incidents) {
		this.incidents = incidents;
	}


}
